
#include <iostream>
#include "token.hpp"

using namespace std;

ostream & operator<< (ostream &oss, const Token &token)
{
	oss << "<";

	switch (token.type) {
		case INTEGER_NUMBER:
			oss << "INT";
			break;
		case FLOAT_NUMBER:
			oss << "FLOAT";
			break;
		case IDENTIFIER:
			oss << "ID";
			break;
		case MINUS:
			oss << "MINUS";
			break;
		case PLUS:
			oss << "PLUS";
			break;
		case DIV:
			oss << "DIV";
			break;
		case MUL:
			oss << "MUL";
			break;
		case POW:
			oss << "POW";
			break;
		case BRACKET_OPEN:
			oss << "BRACKET_OPEN";
			break;
		case BRACKET_CLOSE:
			oss << "BRACKET_CLOSE";
			break;
		case DEF_KEYWORD:
			oss << "DEF_KEYWORD";
			break;
		case END_OF_COMMAND:
			oss << "END_OF_COMMAND>";
			return oss;
			break;
	}

	oss << ", \"" << token.lexeme << "\">";
	return oss;
}